<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>霜之哀伤</title>
    <link rel="stylesheet" type="text/css" href="/static/writer/css/index-2017051107-f.css">
    <link rel="stylesheet" type="text/css" href="/static/writer/css/UBXCMkzNVlaZYNs-f.css">
    <!--<link rel="stylesheet" type="text/css" href="/static/writer/css/bootstrap.min.css">-->



    <style>
        .content {
            font-size: 20px;
        }

        .content-zuopin {
            width: 1600px;
            height: 1600px;
            /* border: 1px solid red; */

        }

        .content-all {
            width: 1020px;
            height: 1200px;
            /* border: 1px solid red; */
            margin: 100px 325px;
        }

        .inputys {

            border: 1px solid rgb(111, 111, 111);

        }

        .zuopin {
            padding: 20px 200px;
        }

        .zhengwen {
            margin: 0px 70px;

        }

        .zpzw {
            margin: 0px 5px;
        }

        .zuopzj {
            margin: 0px -197px;
        }

        .zpfl {
            margin: 0px 35px;
        }

        .fm-all {
            width: 400px;
            height: 250px;
            /* border: 1px solid red; */
            margin: 25px 270px;
        }

        .fm {
            width: 200px;
            height: 200px;
            border: 1px solid rgb(111, 111, 111);
        }

        .error {
            color: red;
        }
        .shum{
            font-size: 25px;
            margin: 75px 60px;
        }
        .zhangjie{
            border: 1px solid rgb(111, 111, 111);
        }
        .tijiao{
            background-color: rgb(249,147,43);
            color:black ;
            width:100px;
            height:50px;
        }
        .name{
            color: #0C82D9;
        }
        .table{
            width: 1500px;
            height:200px;
            text-align: center;
            margin: 110px 70px;
            font-size: 20px;
        }
        .table th{
            border: 1px solid rgb(111,111,111);
        }
        .table td{
            border: 1px solid rgb(111,111,111);
        }
    </style>
</head>

<body>

<div id="root">
    <div data-reactroot="" class="framePage">
        <div class="content-wrap">

            <!-- 头部 -->
            <header class="topbar"><h1 class="topbar-logo"><img src=""></h1><!-- react-empty: 118 -->
                <div class="topbar-right">
                    <ul class="top-nav clearfix">
                        <li class="topbar-sp-width">
                            <div class="fontsize14"><a href="{:url('index/writerpersonal')}">{$penname}</a></div>
                        </li>
                        <li class="user">
                            <div><a href=""><img class="frame-message-img"
                                                 src=""></a>
                            </div>
                        </li>
                        <li class="logout"><a href="{:url('index/writerout')}"><img class="frame-logout-img"
                                                                                    src=""></a>
                        </li>
                    </ul>
                </div>
            </header>


            <!-- 左导航栏 -->
            <div class="sidebar">
                <ul class="nav">

                    <li class="nav-tab" data-url="#/"><h3 class="active"><i class="anticon anticon-shortlong"></i>
                        作品管理</h3>
                        <ul class="two-nav" style="display: block;">
                            <li><a class="sidebarItems colorWhite" href="{:url('index/writerpersonal')}">
                                <div class="sidebarItems-text">作品列表</div>
                            </a></li>
                            <li><a class="sidebarItems colorWhite" href="{:url('writerfound')}">
                                <div class="sidebarItems-text">创建新书</div>
                            </a></li>
                            <li><a class="sidebarItems" href="{:url('index/authormoney')}">
                                <div class="sidebarItems-text">作者资产</div>
                            </a></li>
                        </ul>
                    </li>
                    <li class="nav-tab"><a class="" href="{:url('index/writerinfo')}"><h3><i class="anticon anticon-user"></i>
                        作者信息</h3></a></li>
                    <li class="nav-tab"><a class="" href="{:url('index/writerdata')}"><h3><i class="anticon anticon-tablet"></i>
                        作品数据</h3></a></li>
                    <li class="nav-tab"><a href="{:url('index/writernwes')}"><h3><i class="anticon anticon-short"></i>消息管理
                    </h3></a>

                    <li class="nav-tab"><a class="" href="{:url('index/writercheckout')}"><h3><i class="anticon anticon-money"></i>
                        结算中心</h3></a></li>
                </ul>
            </div>
            <div class="content-page">
                <div class="createbookPage">


                    <!--{block name="kth"}-->
                    <!-- 可替换主题部分 -->

                <table style="width: 1200px;text-align: center">
                    <tr style="font-size: 20px;background-color: rgb(220,246,246);">
                        <th style="height: 50px;">用户名</th>
                        <th>小说名</th>
                        <th>评论内容</th>
                        <th>评论时间</th>
                        <th>操作</th>
                    </tr>
                    {foreach $list as $k}
                    <tr style="font-size: 15px;height: 60px;">
                        <td>{$k['nickname']}</td>
                        <td>{$k['name']}</td>
                        <td>{$k['content']}</td>
                        <td>{$k['time']|date="y-m-d H:i:s",###}</td>
                        <td>
                            <button style="width: 50px;height: 40px;background-color: rgb(220,246,246);color: #0f0f0f">回复</button>
                            <button style="width: 50px;height: 40px;background-color: rgb(220,246,246);color: #0f0f0f" class="del" del-id="{$k['id']}">删除</button>
                        </td>
                    </tr>
                    {/foreach}
                </table>
                    <!--可替换结束-->
                    <!--{/block}-->


                </div>

            </div>
        </div>
    </div>
</div>
<script src="/static/writer/js/jquery-1.8.3.min.js"></script>
<script src="/static/writer/js/toastr.min.js"></script>
<script>
    //删除
    $(function () {
        $('.del').click(function () {
            delid = $(this).attr('del-id');
            if(confirm('您确定要删除这条评论吗?')) {
                //选中该按钮的父级元素
                var obj = $(this).parents('tr');
                //执行兑换操作
                del(delid, obj);
            }
        });
    });

    //执行删除
    function del(delid,obj) {
        $.ajax({
            type:'get',
            url:'/writer/index/writerdel?id=' + delid,
            datetype:'json',
            success:function (data) {

                if(data.status){
                    obj.remove();
                }else{
                    alert('删除失败');
                }
            },
            error: function () {
                // AJAX执行失败
                alert('ajax操作失败');
            }
        });
    }
</script>

</body>
</html>